Ext.define('Zm.view.model.Edit',{
    extend:'Ext.window.Window',
    alias:'widget.modeledit',
    uses:['Ext.form.Panel',
        'Ext.form.field.Text',
        'Ext.form.field.TextArea',
        'Ext.form.field.Hidden',
        'Zm.view.model.TreeAttrList',
        'Zm.i18n.Lang'
    ],
    layout:'fit',
    autoShow:true,
    width:700,
    modal:true,
    
    initComponent: function(){
        var me = this,
            lang = Zm.i18n.Lang;
        Ext.apply(me,{
            title:lang.tModelEdit,
            items:[{
                xtype:'form',
                bodyStyle:'padding:5px 5px 0',
                fieldDefaults:{
                    labelAlign:'right',
                    labelWidth: 120,
                    anchor:'99%'
                },
                items:[{
                    xtype:'textfield',
                    name:'ddname',
                    itemId:'ddname',
                    fieldLabel:lang.tDdname,
                    allowBlank:false
                },{
                    xtype:'textfield',
                    name:'modelurl',
                    itemId:'modelurl',
                    fieldLabel:lang.tModelUrl
                },{
                    xtype:'textarea',
                    name:'memo',
                    itemId:'memo',
                    fieldLabel:lang.tMemo
                },{
                    xtype:'modeltreeattr',
                    title:lang.tAttrList,
                    itemId:'attrlist',
                    height:300
                },{
                    xtype:'hidden',
                    itemId:'ddid',
                    name:'ddid'
                }],
                buttonAlign:'center',
                buttons:[{
                    text:lang.tSave,
                    formBind:true,
                    action:'save'
                },{
                    text:lang.tCancel,
                    handler: function(){
                        me.close();
                    }
                }]
            }]
        });
        me.callParent(arguments);
    }
});